package org.bronycorps.mlptss.domain.ai.actor;

import org.bronycorps.mlptss.domain.actor.AbstractActor;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

public abstract class VirtualActor {
	protected Rectangle hitBox;
	protected Vector2 position;
	protected float radius = 1;
	protected float scale = 1;

	protected AbstractActor source;

	public VirtualActor(AbstractActor source) {
		this.source = source;
		this.position = new Vector2(source.getModel().getPosition());
		this.scale = source.getScaleX();
		this.hitBox = new Rectangle(source.getHitBox());
		this.radius = source.getHitBoxRadius();
	}

	public VirtualActor(VirtualActor source) {
		this.source = source.source;
		this.position = new Vector2(source.position);
		this.scale = source.scale;
		this.hitBox = source.getSource().getRelativeHitBox();
		this.radius = source.radius;
	}

	public abstract VirtualActor createSnapshot();

	public Rectangle getHitBox() {
		return this.hitBox;
	}

	public Vector2 getPosition() {
		return this.position;
	}

	public float getRadius() {
		return this.radius;
	}

	public float getScale() {
		return this.scale;
	}

	public AbstractActor getSource() {
		return this.source;
	}

	public void setPosition(float x, float y) {
		this.position.set(x, y);
	}

	public void setPosition(Vector2 position) {
		this.position = position;
	}

	public void setScale(float scale) {
		this.scale = scale;
	}

}
